/*
 * $Id: NbspBeanInfo.java,v 1.1 2013/07/27 08:04:48 administrator Exp $
 */
package com.roc.tag;

import java.io.IOException;
import java.io.Writer;

import javax.servlet.jsp.JspException;

import org.apache.struts2.components.Component;

import com.opensymphony.xwork2.util.ValueStack;
import com.roc.util.Constance;


/**
 * @author $Author: administrator $
 * @version $Revision: 1.1 $
 */
public class NbspBeanInfo extends Component {
	private String body;

	/**
	 * @param stack
	 */
	public NbspBeanInfo(ValueStack stack) {
		super(stack);
	}
    public boolean start(Writer writer) {
        boolean result = super.start(writer);
		try {
			if(!Constance.isNotEmpty(body)){
				writer.write("&nbsp;");
			}else{
				writer.write(body);
			}
		} catch (IOException e) {
			fieldError("indexId","",new JspException("Encountered input/output error:"+e.toString()));
		}
        return result;
    }
	/**
	 * @return the body
	 */
	public String getBody() {
		return body;
	}
	/**
	 * @param body the body to set
	 */
	public void setBody(String body) {
		this.body = body;
	}

}
